def power(x):
    return x*x

def powern(x,n=2):
    result = 1
    while n>0:
        result = result * x
        n = n-1
    return result

def calc(*nums):
    sum = 0
    for i in nums:
        sum = sum + i
    return sum

def add_end(l=None):
    if l is None:
        l=[]
    l.append('end')
    return l

# 关键字参数
def person(name , age , **kw):
    print(name,age,kw)

# 命名关键字参数
def person(name,age,*,city,job):
    print(name,age,city,job)

# 练习
def mul(*args):
    if len(args)==0:
        raise TypeError
    result = 1
    for i in args:
        result *= i
    return result

# 递归
def fact(n):
    if n==1:
        return 1
    return n*fact(n-1)

# 尾递归优化

# 汉诺塔

# 测试
print(fact(100))



